﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MVCBug.Models
{
    public class DataManager
    {


        private MVCBugDataContext _datacontext;
        public DataManager(string ConnectionString)
        {
            _datacontext = new MVCBugDataContext(ConnectionString);
        }

        private MembershipRepositry _membershipRepositry;
        public MembershipRepositry Membership
        {
            get
            {
                if (_membershipRepositry == null)
                    _membershipRepositry = new MembershipRepositry();

                return _membershipRepositry;
            }
        }

        private TaskRepositry _taskRepositry;
        public TaskRepositry Tasks
        {
            get
            {
                if (_taskRepositry == null)
                    _taskRepositry = new TaskRepositry(_datacontext);

                return _taskRepositry;
            }
        }

        private StateRepositry _stateRepositry;
        public StateRepositry States
        {
            get
            {
                if (_stateRepositry == null)
                    _stateRepositry = new StateRepositry(_datacontext);

                return _stateRepositry;
            }
        }



    }
}